﻿@{
    Layout = "_CompanyLayout";
}

<script type="text/javascript">
    $(document).ready(function () {
        $("#form").submit(function () {

        });
        $("#form").ajaxForm(function (message) {
            if (message.returnCode == "001") {
                alert("保存成功");
                location.href = "/Position/GetComPosition?email=@User.Identity.Name&status=" + status;

            }
            else if (message.returnCode == "4040") {
                alert("企业还未通过管理员审核，不能发布职位！");

            } else if (message.returnCode == "4050") {
                alert("只能保留20个职位信息！");

            }
        });
    });
</script>
<style>
    .selectName {
        text-align: center;
        border: 1px solid #ccc;
        padding: 6px 4px;
        width: 49%;
        border-radius: 4px;
    }
</style>
<div class="container" id="informationEdit">
    <form action="/Position/Add" method="post" id="form">
        <div class="row clearfix">
            <div class="col-md-6 column">
                <div class="form-group">
                    <input type="hidden" class="form-control" name="companyId" value="@ViewData["companyId"]" />
                    <label style="color:red">职位名称</label>
                    <input type="text" class="form-control" name="name" required />
                </div>
            </div>
            <div class="col-md-6 column">
                <div class="form-group">
                    <label style="color:red">职位类型</label>
                    <div>
                        <select name="bigPosition" id="BigPosition" class="selectName" required>
                        </select>
                        <select name="smallPosition" id="SmallPosition" class="selectName" required>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row clearfix">
            <div class="col-md-6 column">
                <div class="form-group">
                    <label style="color:red">资薪</label>
                    <select name="salary" class="form-control" required>
                        <option>面议</option>
                        <option>0-2K</option>
                        <option>2-4K</option>
                        <option>4-6K</option>
                        <option>6-8K</option>
                        <option>8-10K</option>
                    </select>
                </div>
            </div>
            <div class="col-md-6 column">
                <div class="form-group">
                    <label style="color:red">工作地点</label>
                    <div>
                        <select name="provincial" id="Provincial" class="selectName" required>
                        </select>
                        <select name="municipal" id="Municipal" class="selectName" required>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row clearfix">
            <div class="col-md-6 column">
                <div class="form-group">
                    <label style="color:red">招聘人数</label>
                    <input type="text" class="form-control" name="recruitNumber" required />
                </div>
            </div>
            <div class="col-md-6 column">
            </div>
        </div>
        <div class="row clearfix">
            <div class="col-md-12 column">
                <div class="form-group">
                    <label style="color:red">职位描述</label>
                    <textarea name="jobDescription" class="form-control" style="height:128px" placeholder="请输入职位描述..." required></textarea>
                </div>
            </div>
        </div>
        <div class="row clearfix">
            <div class="col-md-12 column">
                <div class="form-group">
                    <label style="color:red">职位要求</label>
                    <textarea name="jobRequirement" class="form-control" style="height:128px" placeholder="请输入职位要求..." required></textarea>
                </div>
            </div>
        </div>
        <div class="row clearfix">
            <div class="col-md-6 column">
                <div class="form-group">
                    <button id="save" type="submit" class="btn btn-primary btn-default" style="float:right;" name="status" value="2" data-loading-text="保存中...">保存至草稿箱</button>
                </div>
            </div>
            <div class="col-md-6 column">
                <div class="form-group">
                    <button id="publish" type="submit" class="btn btn-primary btn-default" style="float:left;" name="status" value="1" data-loading-text="发布中...">发布职位</button>
                </div>
            </div>
        </div>
    </form>
</div>
<script src="https://cdn.bootcss.com/jquery.form/4.2.0/jquery.form.min.js"></script>
<script type="text/javascript" src="~/js/area.js"></script>
<script type="text/javascript" src="~/js/position.js"></script>
<script type="text/javascript" src="~/js/industry.js"></script>
<script type="text/javascript" src="~/js/select.js"></script>
